package com.zr.model;
// Generated 2017-7-10 13:41:39 by Hibernate Tools 4.0.0.Final

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Cuser generated by hbm2java
 */
@Entity
@Table(name = "cuser", catalog = "cqlwlps")
public class Cuser implements java.io.Serializable {

	private Integer uid;
	private Crole crole;
	private String uname;
	private String uroot;
	private String upassword;
	private String utel;
	private String ustate;
	private Integer disid;
	private Set<Creceipt> creceipts = new HashSet<Creceipt>(0);
	private Set<Cdisstation> cdisstations = new HashSet<Cdisstation>(0);
	private Set<Canswer> canswers = new HashSet<Canswer>(0);
	private Set<Ccarreport> ccarreports = new HashSet<Ccarreport>(0);

	public Cuser() {
	}

	public Cuser(Crole crole, String uname, String uroot, String upassword) {
		this.crole = crole;
		this.uname = uname;
		this.uroot = uroot;
		this.upassword = upassword;
	}

	public Cuser(Crole crole, String uname, String uroot, String upassword, String utel, String ustate, Integer disid,
			Set<Creceipt> creceipts, Set<Cdisstation> cdisstations, Set<Canswer> canswers,
			Set<Ccarreport> ccarreports) {
		this.crole = crole;
		this.uname = uname;
		this.uroot = uroot;
		this.upassword = upassword;
		this.utel = utel;
		this.ustate = ustate;
		this.disid = disid;
		this.creceipts = creceipts;
		this.cdisstations = cdisstations;
		this.canswers = canswers;
		this.ccarreports = ccarreports;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)

	@Column(name = "uid", unique = true, nullable = false)
	public Integer getUid() {
		return this.uid;
	}

	public void setUid(Integer uid) {
		this.uid = uid;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "rid", nullable = false)
	public Crole getCrole() {
		return this.crole;
	}

	public void setCrole(Crole crole) {
		this.crole = crole;
	}

	@Column(name = "uname", nullable = false)
	public String getUname() {
		return this.uname;
	}

	public void setUname(String uname) {
		this.uname = uname;
	}

	@Column(name = "uroot", nullable = false)
	public String getUroot() {
		return this.uroot;
	}

	public void setUroot(String uroot) {
		this.uroot = uroot;
	}

	@Column(name = "upassword", nullable = false)
	public String getUpassword() {
		return this.upassword;
	}

	public void setUpassword(String upassword) {
		this.upassword = upassword;
	}

	@Column(name = "utel", length = 11)
	public String getUtel() {
		return this.utel;
	}

	public void setUtel(String utel) {
		this.utel = utel;
	}

	@Column(name = "ustate")
	public String getUstate() {
		return this.ustate;
	}

	public void setUstate(String ustate) {
		this.ustate = ustate;
	}

	@Column(name = "disid")
	public Integer getDisid() {
		return this.disid;
	}

	public void setDisid(Integer disid) {
		this.disid = disid;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "cuser")
	public Set<Creceipt> getCreceipts() {
		return this.creceipts;
	}

	public void setCreceipts(Set<Creceipt> creceipts) {
		this.creceipts = creceipts;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "cuser")
	public Set<Cdisstation> getCdisstations() {
		return this.cdisstations;
	}

	public void setCdisstations(Set<Cdisstation> cdisstations) {
		this.cdisstations = cdisstations;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "cuser")
	public Set<Canswer> getCanswers() {
		return this.canswers;
	}

	public void setCanswers(Set<Canswer> canswers) {
		this.canswers = canswers;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "cuser")
	public Set<Ccarreport> getCcarreports() {
		return this.ccarreports;
	}

	public void setCcarreports(Set<Ccarreport> ccarreports) {
		this.ccarreports = ccarreports;
	}

}
